/**
 * Copyright (2017, ) Institute of Software, Chinese Academy of Sciences
 */
package cn.abcsys.cloud.devops.runtime.incubates.utils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author wuheng(wuheng@otcaix.iscas.ac.cn)
 * @date   Jul 10, 2017
 *
 */
public class IOUtils {

	public static BufferedReader createBufferedReader(Process process) throws Exception {
		try  {
			return new BufferedReader(
				new InputStreamReader(process.getInputStream()));
		} catch (Exception e) {
			return null;
		}
	}
	
	public static void closeBufferedReader(BufferedReader br) throws IOException {
		if(br != null) {
			br.close();
		}
	}
}
